import React, {Component} from 'react';
import Markdown from 'react-markdown';
import {Anchor, Row, Col} from 'antd';

const {Link} = Anchor;

class JsPage extends Component {
    constructor(props) {
        super(props);
    }


    render() {

        return (
            <div style={{background:"#c0d2bc"}}>
                <Row>
                    <Col span={19}>
                        <h3 id="git_reback"> Git回滚代码到某个commit </h3>
                        <Markdown source={"1、回退命令\n" +
                        "\n" +
                        "    $ git reset --hard HEAD^         回退到上个版本\n" +
                        "    $ git reset --hard HEAD~3        回退到前3次提交之前，以此类推，回退到n次提交之前\n" +
                        "    $ git reset --hard commit_id     退到/进到 指定commit的sha码\n" +
                        "\n" +
                        "2、推到远程\n" +
                        "\n" +
                        "    git push origin HEAD --force"}/>

                        <h3 id="git_cover"> 远程分支覆盖本地分支 </h3>
                        <Markdown source={"   \n" +
                        "    git checkout develop_1  \n" +
                        "    git reset –hard develop_2  \n" +
                        "    git push -f"}/>

                        <h3 id="git_merge"> 分支合并 </h3>
                        <Markdown source={"    git checkout dev_20220509\n" +
                        "    git branch |grep pre_001\n" +
                        "    git merge feature/20190302_pre_001\n" +
                        "然后解决冲突,对比下分支"}/>


                        <h3 id="git_solution"> 问题解决 </h3>
                        <Markdown source={">1、is under Git, but is not registered in the Settings\n\n" +
                        "点击 event log  或者直接点击错误 ，日志下方点击Configure ，将缺失git的项目选择后 ，点击 +\n\n" +
                        "2、.gitignore文件不起作用\n\n" +
                        "    git rm -r --cached .\n" +
                        "    git add .\n" +
                        "    git commit -m 'update .gitignore'"}/>



                    </Col>

                    <Col span={5}>
                        <Anchor showInkInFixed="true" style={{background:"#ebefe0"}}>
                            <Link href="#git_reback" title="Git回滚代码到某个commit"/>
                            <Link href="#git_cover" title="远程分支覆盖本地分支"/>
                            <Link href="#git_merge" title="分支合并"/>
                            <Link href="#git_solution" title="问题解决"/>
                         </Anchor>
                    </Col>
                </Row>
            </div>

        );
    }
}

export default JsPage;